package cn.ydxiaoshaui.aip.imageclassify.bean;

import cn.ydxiaoshaui.aip.common.BaikeInfo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

import java.io.Serializable;
import java.util.List;

/**
 * @Description 车型识别
 * @author 小帅丶
 * @className CarDetect
 * @Date 2019/9/26
 **/
public class CarDetect implements Serializable {
    private static final long serialVersionUID = 1L;
    /** 唯一的log id，用于问题定位 */
    private Long log_id;
    /** 标签结果数组 */
    private List<Result> result;
    /** 颜色 */
    private String color_result;

    /** 车在图片中的位置信息 */
    private LocationResult location_result;


    public Long getLog_id() {
        return log_id;
    }

    public void setLog_id(Long log_id) {
        this.log_id = log_id;
    }

    public List<Result> getResult() {
        return result;
    }

    public void setResult(List<Result> result) {
        this.result = result;
    }

    public String getColor_result() {
        return color_result;
    }

    public void setColor_result(String color_result) {
        this.color_result = color_result;
    }

    public LocationResult getLocation_result() {
        return location_result;
    }

    public void setLocation_result(LocationResult location_result) {
        this.location_result = location_result;
    }

    private static class Result{
        /** 置信度，0-1 */
        private Double score;
        /** 年份 */
        private String year;
        /** 车型名称 */
        private String name;
        /** 对应识别结果的百科词条名称 */
        private BaikeInfo baike_info;

        public Double getScore() {
            return score;
        }

        public void setScore(Double score) {
            this.score = score;
        }

        public String getYear() {
            return year;
        }

        public void setYear(String year) {
            this.year = year;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public BaikeInfo getBaike_info() {
            return baike_info;
        }

        public void setBaike_info(BaikeInfo baike_info) {
            this.baike_info = baike_info;
        }
    }

    private static class LocationResult{
        /** 车辆目标框的宽度 */
        private Double width;
        /** 车辆目标框的顶坐标 */
        private Double top;
        /** 车辆目标框的高度 */
        private Double height;
        /** 车辆目标框的左坐标 */
        private Double left;

        public Double getWidth() {
            return width;
        }

        public void setWidth(Double width) {
            this.width = width;
        }

        public Double getTop() {
            return top;
        }

        public void setTop(Double top) {
            this.top = top;
        }

        public Double getHeight() {
            return height;
        }

        public void setHeight(Double height) {
            this.height = height;
        }

        public Double getLeft() {
            return left;
        }

        public void setLeft(Double left) {
            this.left = left;
        }
    }
    @Override
    public String toString() {
        return JSON.toJSONString(this, new SerializerFeature[] {
                SerializerFeature.WriteMapNullValue,
                SerializerFeature.WriteNullListAsEmpty,
                SerializerFeature.WriteNullStringAsEmpty,
                SerializerFeature.WriteNullNumberAsZero,
                SerializerFeature.WriteNullBooleanAsFalse,
                SerializerFeature.UseISO8601DateFormat });
    }
}
